-
Notifications
You must be signed in to change notification settings - Fork 40
Demangle explicitly named object parameters #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Demangle explicitly named object parameters #299
Conversation
This is a patch that allows for the ability to demangle code like: ``` struct Foo { void bar(this Foo && self); }; ``` An example mangling is `_ZNH1S3fooES_` which then demangles to `S::foo(this S)`. The proposal can be found here: itanium-cxx-abi/cxx-abi#148
6e07982
to
d1b6b2f
Compare
@khuey this is something I have in the works, what do you think of it? Let me know what can be cleaned up, or done in a better manner. |
Is this a mere proposal at this stage or are gcc/clang actually using this? |
Clang is using it: llvm/llvm-project#72881 |
/// | ||
/// ```text | ||
/// <ref-qualifier> ::= R # & ref-qualifier | ||
/// ::= O # && ref-qualifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description here needs to be updated.
@@ -1938,19 +1947,28 @@ impl<'a> GetLeafName<'a> for UnscopedTemplateName { | |||
/// ```text | |||
/// <nested-name> ::= N [<CV-qualifiers>] [<ref-qualifier>] <prefix> <unqualified-name> E | |||
/// ::= N [<CV-qualifiers>] [<ref-qualifier>] <template-prefix> <template-args> E | |||
/// ::= N H <prefix> <unqualified-name> E | |||
/// ::= N H <template-prefix> <template-args> E |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these variants don't admit the CvQualifiers or RefQualifier I think it would be better to create new NestedName variants for them.
ctx.is_template_prefix_in_nested_name = true; | ||
p.demangle(ctx, scope)?; | ||
ctx.is_template_prefix_in_nested_name = false; | ||
} | ||
} | ||
|
||
if self.has_explicit_obj_param() { | ||
ctx.is_explicit_obj_param = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to track this state on the context it will have to be cleared somewhere, right?
This is a patch that allows for the ability to demangle code like:
An example mangling is
_ZNH1S3fooES_
which then demangles toS::foo(this S)
.The proposal can be found here: itanium-cxx-abi/cxx-abi#148